package com.jiaoyou.baojian.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.jiaoyou.baojian.fragment.MeihuoTabFragment;
import com.jiaoyou.baojian.fragment.TuhaoTabFragment;

/**
 * Created by DemonZYM on 17/4/12.
 */

public class TopPagerAdapter extends FragmentPagerAdapter {
    public TopPagerAdapter(FragmentManager fm) {
        super(fm);
    }

    @Override
    public Fragment getItem(int position) {
        switch (position){
            case 0:
                return TuhaoTabFragment.newInstance();
            case 1:
                return MeihuoTabFragment.newInstance();
        }
        return null;
    }

    @Override
    public int getCount() {
        return 2;
    }

    @Override
    public CharSequence getPageTitle(int position) {
        switch (position) {
            case 0:
                return "土豪";
            case 1:
                return "魅惑";
        }
        return null;
    }
}
